package lab02.test11;

public class Rectangle implements Printx{
    double a;
    double b;
    Rectangle( double a,double b){

        this.a = a;
        this.b = b;
    }
public double getArea(){
        return a * b;

}

public double getLength(){
    return ( a+b )* 2.0;
}

    @Override
    public void printMyWay() {
        System.out.println( "该矩形的长 a = "+a+" 宽 b = " +b );
        System.out.println("面积 s = " +getArea());
        System.out.println("周长 l = " +getLength());
    }
}
